<template>
  <view class="message-item">
    <view class="message-item-inner">
      <u-avatar class="message-item__avatar" :size="32" :src="item.avatar" />
      <view class="message-item__text">{{ text }}</view>
    </view>
  </view>
</template>
<script>
export default {
  name: 'TextMessage',
  props: {
    item: {
      type: Object,
      default: () => ({
        avatar: '',
        flow: 'out',
        m_data: {
          text: ''
        }
      }),
      required: true
    }
  },
  computed: {
    text() {
      return this.item.m_data.text || ''
    }
  }
}
</script>
